<!DOCTYPE html>
<!--[if lt IE 7]>      <html class="no-js lt-ie9 lt-ie8 lt-ie7"> <![endif]-->
<!--[if IE 7]>         <html class="no-js lt-ie9 lt-ie8"> <![endif]-->
<!--[if IE 8]>         <html class="no-js lt-ie9"> <![endif]-->
<!--[if gt IE 8]><!--> <html class="no-js"<?php language_attributes(); ?>> <!--<![endif]-->

<head>

    <!-- GENERAL HEADER -->
    <title><?php bloginfo('name'); ?><?php wp_title( '|' ); ?></title>
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no" name="viewport">
    <meta content="black" name="apple-mobile-web-app-status-bar-style">

    <!-- THEME OPTIONS -->
    <?php $canon_options = get_option('canon_options'); ?>
    <?php $canon_options_homepage = get_option('canon_options_homepage'); ?>

    <!-- DYNAMIC HEADER -->
    <?php get_template_part('inc/templates/dynamic_header'); ?>

    <!-- WORDPRESS MAIN HEADER CALL -->
    <?php wp_head(); ?>
    
</head>

<body <?php body_class(); ?>>

    <!--[if lt IE 7]>
        <p class="chromeframe">You are using an outdated browser. <a href="<?php echo get_template_directory_uri(); ?>/http://browsehappy.com/">Upgrade your browser today</a> or <a href="<?php echo get_template_directory_uri(); ?>/http://www.google.com/chromeframe/?redirect=true">install Google Chrome Frame</a> to better experience this site.</p>
    <![endif]-->


    <!-- DYNAMIC CSS -->
    <?php get_template_part('inc/templates/dynamic_css'); ?>


	<!-- LOGO AND MENU -->
    <?php 

        $header_container_id = "";
        if (is_page_template('page-homepage.php')) {
            $canon_options_slider = get_option('canon_options_slider');
            if (!empty($canon_options_slider['slides'])) {
                if (count($canon_options_slider['slides']) === 1) {
                    $header_container_id = "id='static'";
                } else {
                    $header_container_id = "id='slides'";
                }
            }
        }

    ?>

    <div class="header-container" <?php echo $header_container_id; ?>>

        <header>

        	<div class="wrapper clearfix">

                <div id="header_logo">
                    <?php 
                        if (!empty($canon_options['logo_text'])) {
                            echo '<a href="'. home_url() .'" class="logo-text">';
                            echo $canon_options['logo_text'];
                            echo '</a>';
                        } elseif (!empty($canon_options['logo_url'])) {
                            echo '<a href="'. home_url() .'" class="logo"><img src="'. $canon_options['logo_url'] .'" alt="Logo"></a>';
                        } else {
                            echo '<a href="'. home_url() .'" class="logo"><img src="'. get_template_directory_uri() .'/img/logo@2x.png" alt="Logo"></a>';
                        }
                    ?>
                </div>

                
                <!-- WORDPRESS GENERATED -->
                <?php wp_nav_menu(array( 
                    'theme_location'     => 'main_navigation_menu',
                    'menu_id'           => 'nav',
                    'menu_class'        => 'nav',
                    'container'         => 'nav',
                    'container_class'   => '',
                    'container_id'      => 'nav-wrap',
                    'show_home'         => '1'
                    ));
                ?>

            </div>

        </header>

    <!-- CLOSE HEADER CONTAINER ON ALL NON-HOME PAGES -->
    <?php if (!is_page_template('page-homepage.php')) { echo "</div>"; } ?>